<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>后台登录</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/gradesign/js/yongqi.js"></script>
    <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" />

    <style type="text/css">
        #nav-lr li{
            width: 50%;
        }
        #nav-lr li a{
            text-align: center;
        }
        .container{
            width: 415px;
        }
        #login-container{
        	margin-top: 100px;
            width: 400px;
            border:0.2px solid #edf1f2;
        }
        form{
            width: 390px;
            padding-left: 5px;
            margin : 50px;
        }
    </style>
</head>
<body class="hold-transition skin-blue fixed sidebar-mini">
	<div class="container">
        <div class="row">
            <div id="col-xs-12 col-sm-6 col-md-4 col-lg-3">
                <div id="login-container" class="">
                   	<h4 style="text-align: center;">登录</h4>
                    <div id="lrContent" class="tab-content">
                        <div id="login" class="tab-pane fade in active">
                                <br/>
                                <label class="">账号：</label>
                                <input type="text" id="username" name="username" class="form-control"  placeholder="用户名/邮箱" /><br/>
                                <label class="">密码:</label>
                                <input type="password" id="password" name="password" class="form-control"  placeholder="密码" />
                                <br/>
                                <p class="pull-right"><a href="">忘记密码？</a></p><br/>
                                <div class="form-group col-xs-offset-4 col-sm-offset-4 col-md-offset-4">
                                    <button class="btn btn-info" onclick="login()">登录</button>
                                    <button class="btn btn-info" onclick="reset()">重置</button>
                                </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript">
	function login(){
		var param= {};
		param.username = $(username).val();
		param.password = $(password).val();
		$.ajax({
			url : "/gradesign/back/loginValidate",
			type : "get",
			data : param,
			async : true,
			dataType : "json",
			success : function(data){
				if(data.result == "success"){
					window.location.href="/gradesign/back/index";
				}else{
				}
			},error : function(){
				yongqi.errorAlert();
			}
		});
	}
	function reset(){
		username = $(username).val("");
		password = $(password).val("");
	}
</script>
</html>